'use strict';
const exec = require('child_process').exec;
let path = './tuiku-debug.apk';
exec("aapt.exe dump badging " + path, function(error, stdout, stderr) {
    if (error) {
        console.log(error.stack);
        console.log('Error code: ' + error.code);
    }
    console.log(typeof stdout)//string
    //解析stdout
    require('fs').createWriteStream('./apk.info').write(stdout)
    let starPos = 'package: name='.length+1;
    let endPos = stdout.indexOf('\'',starPos);
    console.log("包名: " + stdout.substring(starPos,endPos));
});